package avicit.im.lantop.archiveplanmanager.archiveplanedit.action.service;

import avicit.im.lantop.archiveplanmanager.archiveplanedit.domain.ArchivePlan;
import avicit.im.lantop.archiveplanmanager.archiveplanedit.domain.ArchivePlanTree;
import avicit.im.lantop.docmanager.mydocmanager.domain.LantopSubmit;
import avicit.platform6.commons.utils.web.TreeNode;
import org.springframework.web.servlet.ModelAndView;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface ArchivePlanService {

	/**
	 * 添加计划树节点
	 */
	public void addPlanTreeNode(ArchivePlanTree plantree);

	/**
	* 获取归档计划节点
	*
	* @param 
	* @return
	* @throws Exception
	*/
	public List<Map<String, Object>> getPlanTreeNode(String id,String orgId);

	/**
	 * 根据id获取父节点数据
	 *
	 * @param id 节点id
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> findPNodeIdByNodeId(String id);

	/**
	 * 修改计划节点
	 *
	 * @param 
	 * @return
	 * @throws Exception
	 */
	public void editNodeIdByNodeId(ArchivePlanTree plantree);

	/**
	 * 删除节点
	 *
	 * @param 
	 * @return
	 * @throws Exception
	 */
	public Integer delNodeIdByIds(String ids);

	/**
	 * 加载归档计划节点树
	 *
	 * @param planTree
	 * @return List<TreeNode>
	 * @throws Exception
	 * @throws
	 * @author XMW
	 */
	public List<TreeNode> getArchivePlanNodeTree(ArchivePlanTree planTree);

	/**
	 * 查询节点是否是最后节点
	 * @param 
	 * @return
	 * @throws Exception
	 */
	public Boolean findNodeIsLastById(String id, String sysId, String orgId);

	/**
	 * 加载归档计划数据表格
	 * @param 
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> getPlanByNoid(String nodeId, String sysId, String orgId, Integer page, Integer rows, String whereSql,String roleSql);

	/**
	 * 添加归档计划计划
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public void saveArchivePlan(Map<String, Object> param) throws ParseException;

	/**
	 * 添加计划项目
	 * @param
	 * @return
	 * @throws Exception
	 */
	public void saveArchivePlanItem(Map<String, Object> param) throws ParseException;

	/**
	 * 获取计划下的项目数据
	 * @param
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> getTaskReocrdByPlanId(String planId, String sysId, String orgId, Integer page, Integer rows, String whereSql);

	/**
	 * 根据id删除任务
	 *
	 * @param 
	 * @throws Exception
	 * @throws
	 * @author xmw
	 */
	public int delTaskByIds(String ids);

	/**
	 * 根据id删除计划
	 *
	 * @param 
	 * @throws Exception
	 * @throws
	 * @author xmw
	 */
	public int delPlanByIds(String ids);

	/**
	 * 根据id发布计划
	 *
	 * @param 
	 * @throws Exception
	 * @throws
	 * @author xmw
	 */
	public int publishPlan(String ids, String userId, String userName);

	/**
	 * 设置计划项目已归档
	 * @param
	 * @throws
	 * @author xmw
	 */
	public int setTaskStatus(String ids);

	/**
	 * 根据计划id获取归档率
	 *
	 * @param
	 * @throws
	 * @author xmw
	 */
//	public Map<String, Object> refreshPlanRow(String planId);

	/**
	 * 编辑计划的项目
	 * @param
	 * @return
	 * @throws Exception
	 */
	public int editArchivePlanItem(Map<String, Object> param);

	/**
	 * 获取模板数据
	 * @param 
	 * @return
	 * @throws Exception
	 */
	public List<Map<String, Object>> getTemplate(String orgId, String sysId);

	/**
	 * 根据模板查询其下的项目
	 *
	 * @param
	 * @throws
	 * @author xmw
	 */
	public Map<String, Object> getTemplateTask(String orgId, String sysId, String id, Integer page, Integer rows);

	/**
	 * 按模板添加
	 *
	 * @param 
	 * @throws
	 * @author xmw
	 */
	public void setTaskTemplate(String orgId, String sysId, String planId, String modelId);

	/**
	 * 设置归档完结
	 * @param parameter
	 * @return
	 */
	Map<String,Object> setTaskArchiveEnd(LantopSubmit ls,Map<String, Object> parameter) throws Exception;

	/**
	 *根基流程送审表的id获取送审流程计划数据
	 * @param id
	 * @return
	 */
	Map<String,Object> getArchiveSubmintPlanByFlowId( Integer page, Integer rows,String id);

	/**
	 * 流程完结修改计划状态
	 * @param formId
	 */
    void updateSubmitStatus(String formId);

	/**
	 * 根据送审Id获取送审项目所在计划
	 * @param id
	 * @return
	 */
	ArchivePlan getPlanByFromId(String id);


	/**
	 * 我的待办
	 * @param userId
	 * @param taskTitle
	 * @param taskFinished
	 * @param falg
	 * @param page
	 * @param rows
	 * @return
	 */
    Map<String,Object> getMytodos(String userId, String taskTitle, String taskFinished, String falg,String orgId,Integer page, Integer rows);


	/**
	 * 归档计划关联预归档文件
	 * @param fileNodeId
	 * @param fileIds
	 * @param taskId
	 * @return
	 */
    Map<String, Object> saveFlieRelationTask(String orgId,String deptId,String sysId,String fileNodeId, String fileIds, String taskId,String isAn,String searchSbSql);

	/**
	 * 获取关联计划项目的档案文件
	 * @param taskId
	 * @return
	 */
	Map<String, Object> getRelationTaskArchive(String orgId,String deptId,String sysId,String taskId);

	/**
	 * 修改状态
	 * @param formId
	 * @throws Exception
	 */
    void updateArchiveplan(String formId)throws Exception;


	/**
	 * 创建下载信息
	 * @author xmw
	 * @param orgId
	 * @param deptId
	 * @param sysId
	 * @param recordId（记录ID）
	 * @param downUserId-浏览人
	 * @param tableName（物理表名）
	 * @throws Exception void
	 */
	public void createMyDownByIntfs(String orgId, String deptId, String sysId, String recordId, String downUserId, String tableName) throws Exception;

	Map<String,Object> moveNode(Map<String, Object> param) throws Exception;

	List<TreeNode> findChildsByNodeId(String id) throws Exception;

    List<Map<String, Object>> findArchivePlan();

    ModelAndView getArchivePlanStatus(String nodeName, String orgId) throws  Exception;

	List<Map<String, Object>> getUserInfoByLoginName(String userName);

	/**
	 * 移动审批获取待办列表接口
	 * @param userId
	 * @param taskTitle
	 * @param taskFinished
	 * @param falg
	 * @param orgId
	 * @param page
	 * @param rows
	 * @return
	 */
    Map<String, Object> getDealt(String userId, String taskTitle, String taskFinished, String falg, String orgId, Integer page, Integer rows, String begin, String end)throws Exception;

}
